package com.stateflow.facade.enums;

import com.stateflow.facade.common.util.StringUtils;

/**
 * Created by weiqingming on 2019/12/9.
 * 接收通知信息code枚举
 */
public enum NotifyReceiveEnum {

    SUCCESS("SUCCESS", "成功"),
    FAIL("FAIL", "失败"),;

    NotifyReceiveEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    String code;
    String desc;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static NotifyReceiveEnum getByCode(String code) {
        for (NotifyReceiveEnum item : values()) {
            if (StringUtils.equals(item.getCode(), code)) {
                return item;
            }
        }
        return null;
    }
}
